﻿<Window x:Class="Waf.BookLibrary.Library.Presentation.Views.LendToWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:waf="http://waf.codeplex.com/schemas"
    xmlns:c="clr-namespace:Waf.BookLibrary.Library.Presentation.Converters"
    xmlns:p="clr-namespace:Waf.BookLibrary.Library.Presentation.Properties"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:Waf.BookLibrary.Library.Applications.ViewModels;assembly=Waf.BookLibrary.Library.Applications"
    mc:Ignorable="d" d:DataContext="{d:DesignData Source=../DesignData/SampleLendToViewModel.xaml}"
    Title="{Binding Title}" MinWidth="400" MinHeight="400" SizeToContent="WidthAndHeight" ShowInTaskbar="False" 
    Icon="{StaticResource BookLibraryImageSource}">

    <DockPanel Margin="0,0,11,11">
        <Label Content="{Binding Book.Title, ValidatesOnNotifyDataErrors=False}" ContentStringFormat="{x:Static p:Resources.BookTitle}" 
               Padding="0" DockPanel.Dock="Top" Style="{StaticResource HeaderLabel}"/>
        <RadioButton IsChecked="{Binding IsWasReturned}" Content="{x:Static p:Resources.WasReturnedCheck}" TabIndex="0" DockPanel.Dock="Top"/>
        <RadioButton IsChecked="{Binding IsLendTo}" Content="{x:Static p:Resources.LendToCheck}" TabIndex="1" DockPanel.Dock="Top" Margin="11,7,0,0"/>

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" DockPanel.Dock="Bottom">
            <Button Command="{Binding OkCommand}" Content="{x:Static p:Resources.Ok}" IsDefault="True" TabIndex="3"/>
            <Button Content="{x:Static p:Resources.Cancel}" IsCancel="True" TabIndex="4"/>
        </StackPanel>

        <ListView ItemsSource="{Binding Persons}" SelectedItem="{Binding SelectedPerson, ValidatesOnNotifyDataErrors=False}" IsEnabled="{Binding IsLendTo}"
                  MouseDoubleClick="PersonsListMouseDoubleClick" TabIndex="2" Margin="11,11,0,0">
            <ListView.View>
                <GridView>
                    <GridViewColumn DisplayMemberBinding="{Binding Firstname, ValidatesOnNotifyDataErrors=False}" Header="{x:Static p:Resources.Firstname}" Width="125"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Lastname, ValidatesOnNotifyDataErrors=False}" Header="{x:Static p:Resources.Lastname}" Width="100"/>
                </GridView>
            </ListView.View>
        </ListView>
    </DockPanel>
    
</Window>
